<template>
	<view class="content">
		<button @click="handleScan">扫描二维码</button>
	</view>
</template>

<script setup>
	function handleScan() {
		uni.scanCode({
			scanType: ['qrCode'],
			success: ({result}) => {
				const {code} = JSON.parse(result);
				console.log(code)
				uni.navigateTo({
					url: '/pages/ConfirmLogin/ConfirmLogin?to='+code
				})
			},
			fail(err) {
				console.log(err)
				console.log('出错了')
			}
		})
	}
</script>

<style>
</style>
